package models

import "time"

var (
	StudentStatus map[int]string
	StudentSex    map[int]string
)

// 学生
type Student struct {
	Id            int64     `orm:"description(自增主键)"`
	Sn            string    `orm:"description(唯一标识，如卡号)" json:"-"`
	FamilySn      string    `orm:"description(家庭编号)" json:"-"`
	Users         []*User   `orm:"reverse(many)" json:"-"`
	Travels       []*Travel `orm:"reverse(many)" json:"-"`
	School        *School   `orm:"rel(fk);null;default(0);description(所属学校)" json:"-"`
	Class         *Class    `orm:"rel(fk);null;default(0);description(所在班级)" json:"-"`
	RealName      string    `orm:"description(真实姓名)"`
	IdCard        string    `orm:"description(身份证号)" json:"-"`
	Sex           int       `orm:"description(性别，0男 1女)" json:"-"`
	SexShow       string    `orm:"-" json:"-"`
	IsAtSchool    int       `orm:"description(是否在学校，0不在 1在)"`
	IsAtSchoolBus int       `orm:"description(是否在校车上，0不在 1在)" json:"-"`
	TempIsNormal  int       `orm:"description(学生体温是否正常，0异常,体温高于37.0度 1正常)"`
	Status        int       `orm:"description(状态，0禁用 1启用，禁用后不再给学生家长发送作业、安全等通知)" json:"-"`
	StatusShow    string    `orm:"-" json:"-"`
	Created       time.Time `orm:"auto_now_add;type(datetime);description(创建时间)" json:"-"`
	CreatedShow   string    `orm:"-" json:"-"`
	Updated       time.Time `orm:"auto_now;type(datetime);description(最后一次更新时间)" json:"-"`
	UpdatedShow   string    `orm:"-" json:"-"`
	TeacherList   []*User   `orm:"-"`
	ClassName     string    `orm:"-"`
}

func init() {

	StudentStatus = map[int]string{
		0: "禁用",
		1: "正常",
	}

	StudentSex = map[int]string{
		0: "男",
		1: "女",
	}

}
